package com.wj.tool.common.exception.message;

import org.apache.commons.lang3.StringUtils;

public class SystemMessage extends ApplicationMessage {
    public static final int UNKNOWN_ERROR_CODE = 10001;
    public static final String UNKNOWN_ERROR_10001_MESSAGE = "Server unknown error";
    public static final int CALL_TIMEOUT_CODE = 10002;
    public static final String CALL_TIMEOUT_10002_MESSAGE = "System call timeout";

    public static SystemMessage unknownError(String message) {
        return new SystemMessage(10001, StringUtils.isEmpty(message) ? "Server unknown error" : message, MessageType.SYSTEM);
    }

    public static SystemMessage callTimeOut(String message) {
        return new SystemMessage(10002, StringUtils.isEmpty(message) ? "System call timeout" : message, MessageType.SYSTEM);
    }

    private SystemMessage(int code, String message, MessageType type) {
        super(code, message, type);
    }
}